import { configureStore } from '@reduxjs/toolkit';
import flightReducer from './slices/flightSlice';
import passengerReducer from './slices/passengerSlice';
import bookingReducer from './slices/bookingSlice';
import reportReducer from './slices/reportSlice';
import authReducer from './slices/authSlice';

export const store = configureStore({
  reducer: {
    flights: flightReducer,
    passengers: passengerReducer,
    bookings: bookingReducer,
    reports: reportReducer,
    auth: authReducer,
  },
  middleware: (getDefaultMiddleware) =>
    getDefaultMiddleware({
      serializableCheck: {
        ignoredActions: ['persist/PERSIST'],
      },
    }),
});

export type RootState = ReturnType<typeof store.getState>;
export type AppDispatch = typeof store.dispatch;